/**
 *
 * @description:
 * @author: junyong.hong
 * @createTime: 2018/4/23
 * @version: 1.0.0.0
 * @history:
 *    1、
 *    2、
 *
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import App from './app.vue'

// import './assets/style/test.css'
// import './assets/style/test-stylus.styl'
// import './assets/images/1.jpg'
import './assets/style/global.styl'
// 路由
import createRouter from './config/router'
// vuex
import createStore from './store/store'

Vue.use(VueRouter)
Vue.use(Vuex)

const root = document.createElement('div')
document.body.appendChild(root)

const router = createRouter()
const store = createStore()

store.registerModule('c', {
  state: {
    text: 3
  }
})
// 解绑vuex
// store.unregisterModule('c')
// 监听store变化就会触发
store.watch((state) => state.count + 1, (newCount) => {
  console.log('new count watched:', newCount)
})

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#root')
